package 剑指Offer1;

import java.util.HashSet;
import java.util.Set;

public class _09数组中重复的数字 {
    public int findRepeatNumber(int[] nums) {
        if(nums == null || nums.length == 0) return 0;
        Set<Integer> set = new HashSet<>();
        for (int num : nums) {
            if(!set.add(num)){
                return num;
            }
        }
        return 0;
    }
}
